<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-demo__xlslogthirdpay}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.username" placeholder="用户名" clearable></el-input>
        </el-form-item>
		<el-form-item>
		  <el-input v-model="dataForm.outTradeNo" placeholder="支付流水单号" clearable></el-input>
		</el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <!-- <el-form-item>
          <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
        </el-form-item> -->
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <!-- <el-table-column prop="id" label="" header-align="center" align="center"></el-table-column> -->
        <el-table-column prop="username" label="用户名" header-align="center" align="center"></el-table-column>
		<el-table-column prop="businessType" label="业务类型" header-align="center" align="center">
			<template slot-scope="scope">
				<!--BUY_GOODS:商城消费 BUY_SCORE:购买积分 RECHARGE:充值 UPGRADE:升级-->
			  {{scope.row.businessType === 'BUY_GOODS' ? '商城消费' :
			    scope.row.businessType === 'BUY_SCORE' ? '购买积分' :
				scope.row.businessType === 'RECHARGE' ? '充值' :
				scope.row.businessType === 'UPGRADE' ? '升级' : ''
				 }}
			</template>
		</el-table-column>
        <el-table-column prop="payType" label="支付类型" header-align="center" align="center">
			<template slot-scope="scope">
				<!--支付类型 1-aipay微信 2-aipay支付宝 3-aipay快捷-->
			  {{scope.row.payType === 1 ? '微信' :
			    scope.row.payType === 2 ? '支付宝' :
				scope.row.payType === 3 ? '快捷支付' : ''
				 }}
			</template>
		</el-table-column>
        <el-table-column prop="payMoney" label="支付金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="outTradeNo" label="支付流水单号" header-align="center" align="center"></el-table-column>
        <el-table-column prop="responseTime" label="响应时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="payStatus" label="状态" header-align="center" align="center">
			<template slot-scope="scope">
				<!--状态 0未请求第三方接口  1已获取支付链接或跳入快捷页面 2已接收到异步响应 3处理完回调方法 4处理失败 5重复支付-->
			  {{    scope.row.payStatus === 0 ? '未请求第三方接口' :
				    scope.row.payStatus === 1 ? '已获取支付链接或跳入快捷页面' :
					scope.row.payStatus === 2 ? '已接收到异步响应' :
					scope.row.payStatus === 3 ? '处理完回调方法' :
					scope.row.payStatus === 4 ? '处理失败' :
					scope.row.payStatus === 5 ? '重复支付' : ''
				 }}
			</template>
		</el-table-column>
        <el-table-column prop="createTime" label="创建时间" header-align="center" align="center"></el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './xlslogthirdpay-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/demo/xlslogthirdpay/page',
        getDataListIsPage: true,
        exportURL: '/demo/xlslogthirdpay/export',
        deleteURL: '/demo/xlslogthirdpay',
        deleteIsBatch: true
      },
      dataForm: {
        username: '',
		outTradeNo: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
